<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      class="content-parent"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style8/Level2outlineStyle5Bg.webp'})`,
      }"
    >
      <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
        <!-- digitalShowroom -->
        <digitalShowroomIcon :url="props.info.digitalShowroom" />
      </div>

      <div
        class="content"
        :class="{
          content2: props.info.value && props.info.remarks && !props.info.subTitle,

          content3: !props.info.value && props.info.remarks && props.info.subTitle,
          content4: !props.info.value && props.info.remarks && !props.info.subTitle,
          content6: !props.info.value && !props.info.remarks && !props.info.subTitle,
          content5: props.info.value && !props.info.remarks && !props.info.subTitle,
        }"
      >
        <!-- 标题 -->

        <div class="content-tiitle" v-html="textType(props.info.text)"></div>

        <!-- 内容区 -->
        <div class="right-content">
          <div class="subtitle" v-if="props.info.subTitle">
            {{ props.info.subTitle }}
          </div>
          <div
            class="img-box"
            v-if="props.info.value"
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style8/Level2outlineStyle5BgCover.webp'})`,
            }"
          >
           <div class="cover-parent">
              <img
              class="outline-cover"
              @click="ImgVisible = true"
              :src="urls + props.info.value + '?imageView2/3/format/webp'"
              alt=""
            />
           </div>
          </div>
          <div
            class="img-box img-box-2"
            v-if="!props.info.value && !props.info.remarks"
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style8/Level2outlineStyle4BgCover.webp'})`,
            }"
          ></div>
          <div class="remarks1" v-if="props.info.value && props.info.remarks">
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="4"
            ></TextMax>
          </div>
          <div
            class="remarks2"
            v-else-if="props.info.remarks"
            :class="{
              remarks3: !props.info.subTitle,
            }"
          >
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle ? 11 : 11"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style24',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style8.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
  margin-left: 80px;
  margin-right: 90px;
  margin-top: 0;
}
.content-parent {
  position: relative;
  display: flex;
  //   flex-direction: column;
  //   justify-content: center;
  width: 519px;
  height: 774px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 139px 76px 114px 54px;
}
.content {
  display: flex;

  //   justify-content: center;
  position: relative;
  width: 380px;
}
.content-tiitle {
  display: flex;
  justify-content: center;
  width: 50px;
  height: 226px;
  ::v-deep p {
    width: 24px;
    height: 100%;
    writing-mode: vertical-rl;
    text-orientation: upright; 
    letter-spacing: 4px;
    text-align: center;
    font-family: 'SourceHanSerifCN-Bold';
    font-size: 24px;
    line-height: 24px;

    color: rgba(251, 245, 146, 1);
    text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.5), 0px -1px 1px rgba(0, 0, 0, 0.15);
    &:nth-child(2) {
      position: relative;
      margin-left: 2px;
    }
  }
}
.right-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 273px;
  height: 453px;
  margin-top: 68px;
  margin-left: 66.5px;
}
.subtitle {
  width: 273px;
  font-family: SourceMedium;
  font-size: 18px;
  color: rgba(79, 110, 92, 1);
  line-height: 24px;
  text-align: center;
  margin-bottom: 20px;
}
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden; 
  width: 240px;
  height: 240px; 
  margin-bottom: 20px; 
  overflow: hidden;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.cover-parent{
   display: flex;
 overflow: hidden;
   width: 195.79px;
  height: 195.79px;
  border-radius: 50%;
}
.outline-cover {
  width: 195.79px;
  height: 195.79px;
  object-fit: cover;
  transition: all 0.3s;
  border-radius: 50%;
}

.content2 {
}
.content3 {
}
.content4 {
}
.content5 {
}
.content6 {
}
.outline-cover:hover {
  transform: scale(1.1);
}
.img-box-2 {
}
.remarks1 {
  position: relative;
  width: 272px;
}
.remarks2 {
  position: relative;
  width: 272px;
}
.digitalShowroom-p {
  width: 46px;
  height: 46px;
  position: absolute;
  top: 15px;
  left: 20px; 
  z-index: 15;
}

::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(79, 110, 92, 0.8) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(79, 110, 92, 1) !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>